package com.xinzhi.savingpot.task.controller;

import com.xinzhi.savingpot.task.service.impl.TaskEnrollServiceImpl;
import com.xinzhi.savingpot.util.BaseResponse;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api("领取任务")
@RequestMapping("/taskEnroll")
@CrossOrigin
public class TaskEnrollController {

    @Autowired
    private TaskEnrollServiceImpl taskEnrollService;

    @GetMapping("/enroll")
    public BaseResponse enrollTask(String taskNumber){

        return taskEnrollService.EnrollTask(taskNumber, 1);
    }

}
